<template>
  <div>
    <Modal title="导出" v-model="exportModel1" @on-ok="comfirmExport1" @on-cancel="backoutExport">
      <div>
        <p>是否确认执行导出？</p>
      </div>
    </Modal>
    <Modal title="导出" v-model="exportModel2" @on-ok="comfirmExport2" @on-cancel="backoutExport">
      <div>
        <p>是否确认汇总导出？</p>
      </div>
    </Modal>
    <Modal title="标书盖章" v-model="cancelEdit" @on-ok="editCancel">
      <p>是否确认撤销项目编制</p>
      <!-- <Input placeholder="请填写盖章人" v-model="sealMan"/> -->
    </Modal>
    <div class="swith-btn">
      <Button type="success" @click="openExportMdel1" :disabled="exportBton">执行导出</Button>
      <Button type="success" @click="openExportMdel2" :disabled="exportBton">汇总导出</Button>
    </div>
    <div class="search-bar">
      <div class="search-block">
        <Row type="flex">
          <Col span="18" order="2">
            <Cascader
            change-on-select
              @on-change="getValue($event)"
              style="width:200px"
              :data="dataTree"
              :render-format="format"
              :disabled="easySearchBton"
            ></Cascader>
          </Col>
          <Col span="6" order="1">完成部门:</Col>
        </Row>
      </div>
      <!-- <div class="search-block">
        <span>完成部门:</span>
        <SelectTree
          :props="props"
          :options="dataTree"
          :value="valueId"
          :accordion="isAccordion"
          @getValue="getValue($event)"
        />
      </div> -->
      <div class="search-block">
        <Row type="flex">
          <Col span="18" order="2">
            <Select
              ref="myperson"
              v-model="model1"
              style="width:200px"
              @on-change="getperId($event)"
              :label-in-value="true"
              :disabled="easySearchBton"
            >
              <Option v-for="item in personName" :value="item.id" :key="item.id">{{ item.name }}</Option>
            </Select>
          </Col>
          <Col span="6" order="1">完成人员:</Col>
        </Row>
        <!-- <span>承接人员:</span> -->
      </div>
      <div class="search-block1">
        <Row type="flex">
          <Col span="18" order="2">
            <Select
              v-model="model2"
              style="width:100px"
              @on-change="getyear($event)"
              :label-in-value="true"
              :disabled="easySearchBton"
            >
              <Option v-for="item in yearName" :value="item.id" :key="item.id">{{ item.name }}</Option>
            </Select>
          </Col>
          <Col span="6" order="1">年份:</Col>
        </Row>
        <!-- <span>年份:</span> -->
      </div>
      <!-- <div class="search-block">
        <span>完成人员:</span>
        <Select
          ref="myperson"
          v-model="model1"
          style="width:200px"
          @on-change="getperId($event)"
          :label-in-value="true"
          :disabled="easySearchBton"
        >
          <Option v-for="item in personName" :value="item.id" :key="item.id">{{ item.name }}</Option>
        </Select>
      </div>
      <div class="search-block">
        <span>年份:</span>
        <Select
          v-model="model2"
          @on-change="getyear($event)"
          :label-in-value="true"
          :disabled="easySearchBton"
        >
          <Option v-for="item in yearName" :value="item.id" :key="item.id">{{ item.name }}</Option>
        </Select>
      </div> -->
      <Button type="primary" @click="getNewData" :disabled="easySearchBton">搜索</Button>
      <div class="senior-search-block">
        <Button v-if="clearHigh" type="warning" @click="HighClear">清除高级条件</Button>
        <Poptip trigger="focus" content="包含高级查询内容">
          <Input class="search-content" v-model="keyword" :disabled="highWinButton" />
        </Poptip>
        <Button type="default" @click="OpenhihgLevelSearch" :disabled="highWinButton">高级查询</Button>

        <Button type="primary" style @click="hihgLevelSearch" :disabled="highSearchBton">搜索</Button>
      </div>
      <Tabs @on-click="getTabId">
        <TabPane label="编制项目" icon="ios-browsers">
          <div>
            <Table
              height="500"
              stripe
              border
              :columns="columns"
              :data="data"
              @on-selection-change="selectChange"
            ></Table>
          </div>
          <br />
          <div>
            <Page :total="totalDataNo" @on-change="getpageNum" />
          </div>
        </TabPane>
        <TabPane label="负责项目" icon="ios-browsers-outline">
          <div>
            <Table
              height="500"
              border
              :columns="columns1"
              :data="data1"
              @on-selection-change="selectChange"
            ></Table>
          </div>
        </TabPane>
      </Tabs>
      <transition name="bidding-detail">
        <div class="bidding-block" v-if="organizationDtail">
          <div class="bidding-block-top">
            <div class="bidding-block-close" @click="closeorganizationedtail">
              <!--左上角关闭动作-->
              <Icon type="md-close" />
            </div>
            <span>项目详情</span>
          </div>
          <div class="undertake-title">
            <button class="undertake-title" @click.prevent="which='easynews'">项目基本信息</button>
            <button class="undertake-title" @click.prevent="which='authorizenews'">编制信息</button>
            <button class="undertake-title" @click.prevent="which='finacenews'">财务信息</button>
            <button class="undertake-title" @click.prevent="which='projectprogress'">项目进展</button>
          </div>
          <keep-alive>
            <component
              v-bind:is="which"
              :callbackdata="callbackdata"
              :callbackState="callbackState"
            ></component>
          </keep-alive>
          <div>
            <Button type="primary" @click="closeorganizationedtail">确定</Button>
          </div>
        </div>
      </transition>
      <transition name="bidding-edit">
        <div class="bidding-block" v-if="orgDtailedit">
          <div class="bidding-block-top">
            <div class="bidding-block-close" @click="closeorgedit">
              <!--左上角关闭动作-->
              <Icon type="md-close" />
            </div>
            <span>编制项目</span>
          </div>
          <div>
            <div class="bidding-body">
              <div class="bidding-content">
                <Form ref="editForm" :model="editinfo" :label-width="150" :rules="ruleEdit">
                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">项目信息</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="项目名称：" prop="name">
                            <Input class="bidding-item-input" v-model="editinfo.name" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="项目类别：" prop="type">
                            <Select
                              v-model="editinfo.type"
                              @on-change="changeprin($event)"
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in proType"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.type"/> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="任务单编号：" prop="taskNumber">
                            <Input
                              class="bidding-item-input"
                              v-model="editinfo.taskNumber"
                              disabled
                            />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="建设单位：" prop="developmentOrganization">
                            <Input
                              class="bidding-item-input"
                              v-model="editinfo.developmentOrganization"
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="联系人：" prop="contact">
                            <Input class="bidding-item-input" v-model="editinfo.contact" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="联系方式：" prop="contactPhone">
                            <Input class="bidding-item-input" v-model="editinfo.contactPhone" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="行业类别：" prop="industryType">
                            <Select
                              v-model="editinfo.industryType"
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in carerType"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.industryType"/> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="所属地区：" prop="province">
                            <Select
                              v-model="editinfo.province"
                              style="width:182px"
                              @on-change="choseProvince"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in province"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <Select
                              v-model="editinfo.city"
                              style="width:182px"
                              @on-change="choseCity"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in shi1"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <Select
                              v-model="editinfo.area"
                              style="width:182px"
                              @on-change="choseBlock"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in qu1"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.province"/> -->
                            <!-- <Input class="bidding-item-input" v-model="editinfo.city"/> -->
                            <!-- <Input class="bidding-item-input" v-model="editinfo.area"/> -->
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">编制信息</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="项目编制人员：" prop="editPersonId">
                            <!-- <Input class="bidding-item-input" v-model="editinfo.editPersonId"/> -->
                            <Select
                              v-model="editinfo.editPersonId"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in editPerList"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>

                        <div class="bidding-item">
                          <FormItem label="项目负责人：" prop="principle">
                            <Select
                              v-model="editinfo.principle"
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in projectPrincple"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.principle"/> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="审核人员：" prop="auditor">
                            <Select
                              v-model="editinfo.auditor"
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in allPeo"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.auditor"/> -->
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="审批时间：" prop="auditDate">
                            <DatePicker
                              style="width:200px"
                              type="date"
                              v-model="editinfo.auditDate"
                            ></DatePicker>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="审批部门：" prop="auditDepartmentName">
                            <Input
                              class="bidding-item-input"
                              v-model="editinfo.auditDepartmentName"
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="审批文号：" prop="auditNumber">
                            <Input class="bidding-item-input" v-model="editinfo.auditNumber" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="负责表审核人：" prop="tableAuditor">
                            <Select
                              v-model="editinfo.tableAuditor"
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in allPeo"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.tableAuditor"/> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="工程等级：" prop="projectLevel">
                            <Input class="bidding-item-input" v-model="editinfo.projectLevel" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="生产规模：" prop="productionScale">
                            <Input class="bidding-item-input" v-model="editinfo.productionScale" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="实际完成工作日：" prop="realFinishDate">
                            <DatePicker
                              style="width:200px"
                              type="date"
                              v-model="editinfo.realFinishDate"
                            ></DatePicker>
                            <!-- <Input class="bidding-item-input" v-model="editinfo.realFinishDate" /> -->
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="总投资：" prop="totalInvestment">
                            <Input class="bidding-item-input" v-model="editinfo.totalInvestment" />
                            <p>万元</p>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="环保投资：" prop="envInvestment">
                            <Input class="bidding-item-input" v-model="editinfo.envInvestment" />
                            <p>万元</p>
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">其他</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="备注：" prop="remark">
                            <Input
                              v-model.trim="editinfo.remark"
                              type="textarea"
                              style="width: 910px"
                            />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div>
                    <Button type="primary" @click="submitorgedit('editForm')">确定</Button>
                    <Button @click="closeorgedit">取消</Button>
                  </div>
                </Form>
              </div>
            </div>
          </div>
        </div>
      </transition>

      <transition name="bidding-high">
        <div class="bidding-block" v-if="organizationHigh">
          <Form ref="formHigh" :rules="ruleHigh" :model="equalConditions" :label-width="150">
            <div class="bidding-block-top">
              <div class="bidding-block-close" @click="cancelAdd">
                <!--左上角关闭动作-->
                <Icon type="md-close" />
              </div>
              <span>高级查询</span>
            </div>
            <div>
              <div class="bidding-body">
                <div class="bidding-content">
                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">范围</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="合同日期范围从：">
                            <DatePicker type="date" v-model="rangeConditions[0].sta" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <span>至</span>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <DatePicker type="date" v-model="rangeConditions[0].end" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="收款日期范围从：">
                            <DatePicker type="date" v-model="rangeConditions[1].sta" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <span>至</span>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <DatePicker type="date" v-model="rangeConditions[1].end" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="项目登记日期从：">
                            <DatePicker type="date" v-model="rangeConditions[2].sta" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <span>至</span>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <DatePicker type="date" v-model="rangeConditions[2].end" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="审批日期范围从：">
                            <DatePicker type="date" v-model="rangeConditions[3].sta" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <span>至</span>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <DatePicker type="date" v-model="rangeConditions[3].end" />
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="盖章日期范围从：">
                            <DatePicker type="date" v-model="rangeConditions[4].sta" />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <span>至</span>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem :label-width="50">
                            <DatePicker type="date" v-model="rangeConditions[4].end" />
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">类别</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="行业类别：">
                            <Select
                              v-model="equalConditions.industryType"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in carerType"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="项目类别：">
                            <Select
                              v-model="equalConditions.type"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in proType"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="所属地区：">
                            <Select
                              v-model="equalConditions.province"
                              style="width:200px"
                              @on-change="choseProvince"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in province"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="equalConditions.province" /> -->
                          </FormItem>
                        </div>

                        <div class="bidding-item">
                          <FormItem>
                            <Select
                              v-model="equalConditions.city"
                              style="width:200px"
                              @on-change="choseCity"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in shi1"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="equalConditions.city" /> -->
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem>
                            <Select
                              v-model="equalConditions.area"
                              style="width:200px"
                              @on-change="choseBlock"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in qu1"
                                :value="item.value"
                                :key="item.id"
                              >{{ item.value }}</Option>
                            </Select>
                            <!-- <Input class="bidding-item-input" v-model="equalConditions.area" /> -->
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">状态</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="归档状态：">
                            <Select
                              v-model="equalConditions.hasArchived"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in backFileOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="奖金状态：">
                            <Select
                              v-model="spReward"
                              style="width:200px"
                              clearable
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in rewardOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="合同有无：">
                            <Select
                              v-model="equalConditions.hasContract"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in ifContactOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="收款状态：">
                            <Select
                              v-model="spCollect"
                              style="width:200px"
                              clearable
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in collecOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>

                        <div class="bidding-item">
                          <FormItem label="盖章状态：">
                            <Select
                              v-model="equalConditions.hasUsualSealed"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in sealOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="发票状态：">
                            <Select
                              v-model="spInvoice"
                              style="width:200px"
                              clearable
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in invoiceOption"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div class="panel panel-default bidding-title">
                    <div class="panel-heading">
                      <h4 class="panel-title">其他</h4>
                    </div>
                    <div class="panel-body">
                      <br />
                      <div>
                        <div class="bidding-item">
                          <FormItem label="项目名称：" prop="name">
                            <Input
                              style="width:200px"
                              class="bidding-item-input"
                              v-model="equalConditions.name"
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="承接部门：">
                            <Select
                              v-model="equalConditions.undertakeDepartmentId"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in dptList"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="承接人员：">
                            <Select
                              v-model="equalConditions.undertakePersonId"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in allPeo"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                      </div>
                      <div>
                        <div class="bidding-item">
                          <FormItem label="建设单位：" prop="developmentOrganization">
                            <Input
                              class="bidding-item-input"
                              v-model="equalConditions.developmentOrganization"
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="审批部门：" prop="auditDepartment">
                            <Input
                              style="width:200px"
                              class="bidding-item-input"
                              v-model="equalConditions.auditDepartment"
                            />
                          </FormItem>
                        </div>
                        <div class="bidding-item">
                          <FormItem label="审核人员：">
                            <Select
                              v-model="equalConditions.auditorId"
                              clearable
                              style="width:200px"
                              :label-in-value="true"
                            >
                              <Option
                                v-for="item in allPeo"
                                :value="item.id"
                                :key="item.id"
                              >{{ item.name }}</Option>
                            </Select>
                          </FormItem>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div>
                    <Button type="primary" @click="checkAdd('formHigh')">确定</Button>
                    <Button @click="cancelAdd">取消</Button>
                  </div>
                </div>
              </div>
            </div>
          </Form>
        </div>
      </transition>
    </div>
  </div>
</template>

<script>
import axios from "axios";
// import SelectTree from "../../components/treeSelect.vue";
export default {
  // components: {
  //   SelectTree
  // },
  data() {
    //不含空格 非必填
    const validateSpace = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeSpachs(value);
        if (res === -1) {
          callback(new Error("不能含有空格"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //只能是数字 非必填
    const validateUnNo = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeNo(value);
        if (res === -1) {
          callback(new Error("输入只能是数字"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //只能为数字和字母 非必填
    const validateUnNoLet = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeNoLetter(value);
        if (res === -1) {
          callback(new Error("输入只能是数字或英文符号"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //电话格式  非必填     高级查询
    const validatePhone = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgePhone(value);
        if (res === -1) {
          callback(new Error("号码填写不正确"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //汉字+字母  非必填   高级查询
    const validateLenCHLetter = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeInput(value);
        if (res === -1) {
          callback(new Error("输入只能是汉字和英文"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //数字+汉字+字母  非必填
    const validateLenNoCHLetter = (rule, value, callback) => {
      if (value) {
        const res = this.common.judgeNumberInput(value);
        if (res === -1) {
          callback(new Error("输入只能是汉字、英文或数字符号"));
        } else {
          callback();
        }
      } else {
        callback();
      }
    };
    //只能为数字 必填
    const validateNo = (rule, value, callback) => {
      const res = this.common.judgeNo(value);
      if (res === -1) {
        callback(new Error("输入只能是数字"));
      } else {
        callback();
      }
    };

    //只能为数字和字母 必填
    const validateNoLetter = (rule, value, callback) => {
      const res = this.common.judgeNoLetter(value);
      if (res === -1) {
        callback(new Error("输入只能是数字或英文符号"));
      } else {
        callback();
      }
    };
    //判断输入只能为汉字英文  必填
    const validateChLetter = (rule, value, callback) => {
      const res = this.common.judgeInput(value);
      if (res === -1) {
        callback(new Error("输入只能是汉字或英文符号"));
      } else {
        callback();
      }
    };
    //只能为汉字英文或者数字 必填
    const validateChLetterNo = (rule, value, callback) => {
      const res = this.common.judgeNumberInput(value);
      if (res === -1) {
        callback(new Error("输入只能是汉字、英文或数字符号"));
      } else {
        callback();
      }
    };
    return {
      exportModel1: false,
      exportModel2: false,
      row: {},
      pageNum: 1,
      pageSize: 10,
      modelId: 3,
      totalDataNo: null, //总共的数据个数

      //处理权限disabled
      exportBton: true,
      easySearchBton: true,
      highWinButton: true,
      highSearchBton: true,
      jurisdiction: null, //当前用户的权限
      jurisdictionNo: null, //1标识只有承接，2表示只有管理，3表示都有

      callbackdata: {}, //返回数据
      authorizeDtail: false,
      which: "easynews",
      editinfo: {
        id: null, //项目id
        auditDepartmentName: null, //审批部门----
        auditDepartmentName: null, //审批部门名称
        principle: null, //负责人id---
        tableAuditor: null, //责任表审核人id----
        industryType: null, //行业类别id-----
        industryTypeName: null, //行业类别名称
        auditor: null, //审核人员id----
        editPersonId: null, //编制人员id----
        type: null, //项目类别id-----
        province: null, //省---
        city: null, //市---
        area: null, //区---
        developmentOrganization: null, //建设单位----
        auditDate: null, //审批日期----
        name: null, //项目名称-----
        remark: null, //编制备注----
        taskNumber: null, //任务单编号------
        projectLevel: null, //工程等级-----
        productionScale: null, //生产规模---
        realFinishDate: null, //实际完成天数----
        auditNumber: null, //审批文号-----
        envInvestment: null, //环保投资----
        totalInvestment: null, //总投资----
        editPersonName: null, //编制人员名称
        contactPhone: null, //联系方式-----
        contact: null //联系人----
      },
      submitEditInfo: {
        auditDepartment: null, //审批部门id----
        principle: null, //负责人id---
        tableAuditor: null, //责任表审核人id----
        industryType: null, //行业类别id-----
        auditor: null, //审核人员id----
        editPersonId: null, //编制人员id----
        type: null, //项目类别id-----
        province: null, //省---
        city: null, //市---
        area: null, //区---
        developmentOrganization: null, //建设单位----
        auditDate: null, //审批日期----
        name: null, //项目名称-----
        remark: null, //编制备注----
        taskNumber: null, //任务单编号------
        projectLevel: null, //工程等级-----
        productionScale: null, //生产规模---
        realFinishDate: null, //实际完成天数----
        auditNumber: null, //审批文号-----
        envInvestment: null, //环保投资----
        totalInvestment: null, //总投资----
        contactPhone: null, //联系方式-----
        contact: null //联系人----
        //共23个
      },
      ruleHigh: {
        developmentOrganization: [
          //建设单位 数+英+汉
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        name: [
          //项目名称
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        auditDepartment: [
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ]
      },
      ruleEdit: {
        name: [
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        type: [{ required: true, message: "不能为空", trigger: "blur" }],
        developmentOrganization: [
          { required: true, message: "不能为空", trigger: "blur" },
          { required: true, validator: validateChLetterNo, trigger: "blur" }
        ],
        editPersonId: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        principle: [{ required: true, message: "不能为空", trigger: "blur" }],
        province: [{ required: true, message: "不能为空", trigger: "blur" }],
        totalInvestment: [
          { required: true, message: "不能为空", trigger: "blur" },
          {
            type: "number",
            message: "输入的类型为数字",
            transform(value) {
              return Number(value);
            }
          }
        ],
        contactPhone: [
          //联系方式  非必填
          { required: false, validator: validatePhone, trigger: "blur" }
        ],
        contact: [
          //联系人 英+汉 非必填
          { required: false, validator: validateLenCHLetter, trigger: "blur" }
        ],
        auditDepartmentName: [
          //审批部门  非必填
          { required: false, validator: validateLenCHLetter, trigger: "blur" }
        ],
        auditNumber: [
          //审批文号： 非必填
          { required: false, validator: validateUnNoLet, trigger: "blur" }
        ],
        projectLevel: [
          //工程等级  非必填
          { required: false, validator: validateUnNoLet, trigger: "blur" }
        ],
        productionScale: [
          //生产规模：非必填
          { required: false, validator: validateLenNoCHLetter, trigger: "blur" }
        ],
        envInvestment: [
          //环保投资：非必填
          { required: false, validator: validateUnNo, trigger: "blur" }
        ]
      },
      columns: [
        {
          type: "selection",
          width: 60,
          align: "center",
          fixed: "left"
        },
        {
          title: "序号",
          width: 100,
          key: "id",
          fixed: "left"
        },
        // {
        //   title: "状态",
        //   width: 120,
        //   key: "state"
        // },
        // {
        //   title: "编制状态",
        //   width: 85,
        //   key: "ifedit",
        //   fixed: "right",
        //   render: (h, params) => {
        //     let st = params.row.state;
        //     if (st >= 15) {
        //       if (st < 128) {
        //         return h("Dropdown", [
        //           h("Button", { props: { type: "error" } }, "编")
        //         ]);
        //       }
        //     }
        //   }
        // },
        {
          title: "操作",
          fixed: "right",
          key: "number",
          width: 120,
          render: (h, params) => {
            let st = params.row.state;
            // console.log("title",params.row)
            let tab = {};
            let flag = 0;
            let detailBton = true;
            let editBton = true;
            let exportBton = true;
            if (this.jurisdictionNo >= 1) {
              detailBton = false;
              exportBton = false;
            }

            if (st >= 15) {
              tab = "撤销项目编制";
              flag = 2;
              if (this.jurisdictionNo == 2 || this.jurisdictionNo == 3) {
                editBton = false;
              }
            } else {
              tab = "编制项目";
              flag = 1;
              if (this.jurisdictionNo == 1 || this.jurisdictionNo == 3) {
                editBton = false;
              }
            }
            if (st >= 15 && st < 128) {
              return h("Badge", { props: { text: "编", offset: [13, 0] } }, [
                h(
                  "Dropdown",
                  {
                    on: {
                      "on-click": name => {
                        let rowData = params.row;
                        let id = rowData.id;
                        let st = params.row.state;
                        if (name == "read") {
                          this.row = id;
                          this.setBackdata(st);
                          this.which = "easynews";
                          this.organizationDtail = true;
                        } else if (name == "edit") {
                          this.row = id;
                          if (flag == 1) {
                            this.geteditInfo();
                            this.orgDtailedit = true;
                          } else if (flag == 2) {
                            this.cancelEdit = true;
                          }
                        } else if (name == "export") {
                          this.row = id;
                          this.exportClick();
                        }
                      }
                    },
                    props: {
                      transfer: true
                    }
                  },
                  [
                    h("Button", { props: { type: "primary" } }, "操作>>"),
                    // h("Badge", { props: { text: "编" } }),
                    h("DropdownMenu", { slot: "list" }, [
                      h(
                        "DropdownItem",
                        { props: { name: "read", disabled: detailBton } },
                        "查看详情"
                      ),
                      h(
                        "DropdownItem",
                        { props: { name: "edit", disabled: editBton } },
                        tab
                      ),
                      h(
                        "DropdownItem",
                        { props: { name: "export", disabled: exportBton } },
                        "导出任务单"
                      )
                    ])
                  ]
                )
              ]);
            } else {
              return h(
                "Dropdown",
                {
                  on: {
                    "on-click": name => {
                      let rowData = params.row;
                      let id = rowData.id;
                      let st = params.row.state;
                      if (name == "read") {
                        this.row = id;
                        this.setBackdata(st);
                        this.which = "easynews";
                        this.organizationDtail = true;
                      } else if (name == "edit") {
                        this.row = id;
                        if (flag == 1) {
                          this.geteditInfo();
                          this.orgDtailedit = true;
                        } else if (flag == 2) {
                          this.cancelEdit = true;
                        }
                      } else if (name == "export") {
                        this.row = id;
                        this.exportClick();
                      }
                    }
                  },
                  props: {
                    transfer: true
                  }
                },
                [
                  h("Button", { props: { type: "primary" } }, "操作>>"),
                  h("DropdownMenu", { slot: "list" }, [
                    h(
                      "DropdownItem",
                      { props: { name: "read", disabled: detailBton } },
                      "查看详情"
                    ),
                    h(
                      "DropdownItem",
                      { props: { name: "edit", disabled: editBton } },
                      tab
                    ),
                    h(
                      "DropdownItem",
                      { props: { name: "export", disabled: exportBton } },
                      "导出任务单"
                    )
                  ])
                ]
              );
            }
          }
        }
      ],
      cancelEdit: false,
      data: [],
      data1: [],
      columns1: [
        {
          type: "selection",
          width: 60,
          align: "center",
          fixed: "left"
        },
        {
          title: "序号",
          width: 100,
          key: "id",
          fixed: "left"
        },
        // {
        //   title: "状态",
        //   width: 120,
        //   key: "state"
        // },
        {
          title: "操作",
          fixed: "right",
          key: "number",
          width: 120,
          render: (h, params) => {
            return h(
              "Dropdown",
              {
                on: {
                  "on-click": name => {
                    let rowData = params.row;
                    let id = rowData.id;
                    let st = params.row.state;
                    if (name == "read") {
                      this.row = id;
                      this.setBackdata(st);
                      this.which = "easynews";
                      this.organizationDtail = true;
                    }
                  }
                },
                props: {
                  transfer: true
                }
              },
              [
                h(
                  "Button",
                  {
                    props: {
                      type: "primary"
                    }
                  },
                  "操作>>"
                ),
                h("DropdownMenu", { slot: "list" }, [
                  h("DropdownItem", { props: { name: "read" } }, "查看详情")
                ])
              ]
            );
          }
        }
      ],

      //树型select********************************
      isClearable: true, // 可清空
      isAccordion: true, // 可收起
      valueId: 0, // 查询部门ID
      valueId2: 0,
      //第一个界面的查询*****************
      personName: [{ id: 0, name: "全部" }], //承接人员数组
      model1: 0, //承接人员ID
      dataTree: [], //部门树
      perNo: 0, //在拿人员的时候定义的一共的页数
      yearName: [], //年份数组
      model2: 0, //年份ID
      nowyear: {}, //当前年

      select1: null,
      select2: null,
      select3: null,

      props: {
        // 配置项（必选）
        value: "id",
        label: "name",
        children: "children"
        // disabled:true
      },
      orgDtailedit: false,
      organizationDtail: false,
      whichTable: "authorizetable",
      tabID: 0,
      proType: [], //项目类别名单
      editPerList: [], //编制权限人名单
      dptList: [], //所有部门列表
      carerType: [], //所有行业类别,
      allPeo: [], //所有人的名单
      huanPeo: [], //环评工程师名单
      allPeoPages: null,
      projectPrincple: [], //项目负责人

      organizationHigh: false,
      clearHigh: false,

      equalConditions: {
        //单个字段list
        developmentOrganization: null, //建设单位

        hasArchived: null, //归档状态
        undertakeDepartmentId: null, //承接部门
        undertakePersonId: null, //承接人id
        name: null, //项目名称
        type: null, //项目类别
        province: null,
        city: null,
        area: null,
        industryType: null, //行业类别
        hasUsualSealed: null, //盖章状态
        hasContract: null, //合同有无
        auditDepartment: null, //审批部门
        auditorId: null //审核人员id
        //共14个
      },
      rangeConditions: [
        //传给后端的时间，或金额字段
        {
          field: "contractDate",
          sta: null,
          end: null
        },
        {
          field: "collectionDate",
          sta: null,
          end: null
        },
        {
          field: "registDate",
          sta: null,
          end: null
        },
        {
          field: "auditDate",
          sta: null,
          end: null
        },
        {
          field: "usualSealDate",
          sta: null,
          end: null
        }
      ],
      specialConditions: [], //传给后端的特殊字段

      spCollect: null, //特殊收款状态v-model
      spInvoice: null, //特殊发票状态v-model
      spReward: null, //特殊奖金状态v-model
      // spOutput: null, //特殊业务开支v-model，0或1直接赋值到list，2添加到特殊

      contactOrgOption: [
        //合同归属
        {
          id: "学校",
          name: "学校"
        },
        {
          id: "公司",
          name: "公司"
        }
      ],
      collecOption: [
        //收款状态
        {
          id: "collectionAmount=0",
          name: "尚无收款"
        },
        {
          id: "collectionAmount=fund",
          name: "已收款"
        },
        {
          id: "collectionAmount>0 and collectionAmount<fund",
          name: "部分收款"
        },
        {
          id: "collectionAmount=0 or collectionAmount<fund",
          name: "尚无收款及部分收款"
        },
        {
          id: "collectionAmount>0",
          name: "已收款及部分收款"
        }
      ],
      sealOption: [
        //盖章状态
        {
          id: 0,
          name: "未盖章"
        },
        {
          id: 1,
          name: "已盖章"
        }
      ],
      invoiceOption: [
        //发票状态
        {
          id: "invoiceAmount=0",
          name: "发票未开"
        },

        {
          id: "invoiceAmount>0 and invoiceAmount<fund",
          name: "发票部分开"
        },
        {
          id: "invoiceAmount>0 and invoiceAmount<=fund",
          name: "发票已开+部分开"
        },
        {
          id: "invoiceAmount=0 or (invoiceAmount > 0 and invoiceAmount<fund)",
          name: "发票未开+部分开"
        },
        {
          id: "invoiceAmount=fund and invoiceAmount!=0",
          name: "发票已开"
        }
      ],
      rewardOption: [
        //奖金状态
        {
          id: "rewardAmount=0",
          name: "尚无奖金"
        },
        {
          id: "rewardAmount=collectionAmount and rewardAmount!=0",
          name: "奖金等于收款"
        },
        {
          id: "rewardAmount>collectionAmount",
          name: "奖金多于收款"
        },
        {
          id: "rewardAmount<collectionAmount",
          name: "奖金少于收款"
        },
        {
          id: "rewardAmount<collectionAmount or rewardAmount=0",
          name: "尚无奖金且奖金少于收款"
        }
      ],
      ifContactOption: [
        //合同有无
        {
          id: 0,
          name: "无合同"
        },
        {
          id: 1,
          name: "有合同"
        }
      ],
      outputOption: [
        //业务开支
        {
          id: 0,
          name: "无"
        },
        {
          id: 1,
          name: "有"
        },
        {
          id: 2,
          name: "未处理"
        }
      ],
      contactStateOption: [
        //项目状态
        {
          id: 1,
          name: "正常"
        },
        {
          id: 0,
          name: "废弃"
        }
      ],
      backFileOption: [
        //归档状态
        {
          id: 1,
          name: "已归档"
        },
        {
          id: 0,
          name: "未归档"
        }
      ],

      ids: [],
      keyword: null,
      selectId: [],
      undertakeDPListName: null,
      undertakePRListName: null,
      regDate: null,
      rangeTag: null, //是否是全院
      totalHigh: null, //全院个数
      mapJson: this.IP.IP + "/map.json",
      province: "",
      sheng: "",
      shi: "",
      shi1: [],
      qu: "",
      qu1: [],
      city: "",
      block: "",
      corse1: {
        label: null
      },
      corse2: {
        label: null
      },
      corse3: {
        label: null
      },
      callbackState: {},
      userName: null,
      userDepment: null,
      userID: null,
      userDepmentID: null
    };
  },
  beforeMount() {
    this.getNewData(); //产生表信息
    this.getcolumns(); //产生表头

    this.getdepartments(); //得到部门的name和ID
    this.getNowYear();
    this.getproType(); //项目类别
    this.getEditpersonList(); //编制人员
    this.getCarerType(); //行业类别
    this.getAllPeo(); //得到所有人
    this.getHuanPeo(); //得到环评工程师名单
    this.getCityData();
    this.getUserInfo();
    this.getJurisdiction(); //获得当前用户的权限
    //this.getTotal();
    //console.log(this.valueId);
    //console.log(this.model1);
    //console.log(this.model2);
    //console.log(this.totalDataNo);
  },
  methods: {
    backoutExport() {
      this.exportModel1 = false;
      this.exportModel2 = false;
    },
    comfirmExport1() {
      this.exportModel1 = false;
      this.export1();
    },
    comfirmExport2() {
      this.exportModel2 = false;
      this.export2();
    },

    openExportMdel1() {
      this.exportModel1 = true;
    },
    openExportMdel2() {
      this.exportModel2 = true;
    },

    getJurisdiction() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getPermission"
      }).then(result => {
        this.jurisdiction = result.data.data;
        // console.log("权限", this.jurisdiction);
        var i = 0;
        var judge1 = 0;
        var judge2 = 0;
        for (i; i < this.jurisdiction.length; i++) {
          if (this.jurisdiction[i] == "编制") {
            judge1 = 1;
          }
          if (this.jurisdiction[i] == "管理") {
            judge2 = 1;
          }
        }
        if (judge1 == 1 && judge2 == 1) {
          this.jurisdictionNo = 3;
        } else if (judge1 != 1 && judge2 == 1) {
          this.jurisdictionNo = 2;
        } else if (judge1 == 1 && judge2 != 1) {
          this.jurisdictionNo = 1;
        } else {
          this.jurisdictionNo = -1;
        }
        // console.log("数字权限", this.jurisdictionNo);
        this.handleJurisdiction();
      });
    },
    //处理操作的disabled
    handleJurisdiction() {
      if (this.jurisdictionNo >= 1) {
        this.exportBton = false;
        this.easySearchBton = false;
        this.highWinButton = false;
        this.highSearchBton = false;
      } else {
        this.exportBton = true;
        this.easySearchBton = true;
        this.highWinButton = true;
        this.highSearchBton = true;
      }
    },
    editCancel() {
      axios({
        method: "get",
        url: this.IP.IP + "/edit/undoEdit?projectId=" + this.row
      }).then(result => {
        // console.info("确定撤销");
        //console.log(result);
        var code = "";
        code = result.data.code;
        var msg = result.data.msg;
        if (code == 0) {
          this.$Message.success("撤销项目编制成功");
          this.getNewData1();
        } else {
          this.$Message.error(msg);
        }
      });
    },
    getUserInfo() {
      axios({
        method: "get",
        url: this.IP.IP + "/personAndDepartment"
      }).then(result => {
        // console.info("用户信息");
        //console.log(result);
        this.userName = result.data.data.personName;
        this.userDepment = result.data.data.departmentName;
        this.userID = result.data.data.personId;
        this.userDepmentID = result.data.data.departmentId;
        this.getcolumns1();
      });
    },
    // 选省
    choseProvince: function(e) {
      //console.log("111");
      //console.log(e);
      for (var index2 in this.province) {
        if (e.label === this.province[index2].value) {
          this.shi1 = this.province[index2].children;
          this.shi = this.province[index2].children[0].value;
          this.qu1 = this.province[index2].children[0].children;
          this.qu = this.province[index2].children[0].children[0].value;
          this.E = this.qu1[0].id;
        }
      }
    },
    // 选市
    choseCity: function(e) {
      for (var index3 in this.city) {
        if (e.label === this.city[index3].value) {
          this.qu1 = this.city[index3].children;
          this.qu = this.city[index3].children[0].value;
          this.E = this.qu1[0].id;
          // //console.log(this.E)
        }
      }
    },
    // 选区
    choseBlock: function(e) {
      this.E = e.label;
      // //console.log(this.E)
    },
    getCityData: function() {
      var that = this;
      axios
        .get(this.mapJson)
        .then(function(response) {
          if (response.status == 200) {
            var data = response.data;
            that.province = [];
            that.city = [];
            that.block = [];
            // 省市区数据分类
            for (var item in data) {
              if (item.match(/0000$/)) {
                //省
                that.province.push({
                  id: item,
                  value: data[item],
                  children: []
                });
              } else if (item.match(/00$/)) {
                //市
                that.city.push({ id: item, value: data[item], children: [] });
              } else {
                //区
                that.block.push({ id: item, value: data[item] });
              }
            }
            // 分类市级
            for (var index in that.province) {
              for (var index1 in that.city) {
                if (
                  that.province[index].id.slice(0, 2) ===
                  that.city[index1].id.slice(0, 2)
                ) {
                  that.province[index].children.push(that.city[index1]);
                }
              }
            }
            // 分类区级
            for (var item1 in that.city) {
              for (var item2 in that.block) {
                if (
                  that.block[item2].id.slice(0, 4) ===
                  that.city[item1].id.slice(0, 4)
                ) {
                  that.city[item1].children.push(that.block[item2]);
                }
              }
            }
            // console.info("sheng");
            //console.log(that.province);
            //console.log(that.city);
            //console.log(that.block);
          } else {
            //console.log(response.status);
          }
        })
        .catch(function(error) {
          //console.log(typeof +error);
        });
    },
    downloadSummry(data) {
      if (!data) {
        return;
      }
      var blob = new Blob([data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
      });
      var url = window.URL.createObjectURL(data.data);
      var aLink = document.createElement("a");
      aLink.style.display = "none";
      aLink.href = url;
      aLink.setAttribute("download", "projectRegSummary.xls");
      document.body.appendChild(aLink);
      aLink.click();
      document.body.removeChild(aLink); //下载完成移除元素
      window.URL.revokeObjectURL(url);
    },
    realExportSummary() {
      // console.info("ids");
      //console.log(this.ids);
      axios({
        method: "post",
        url: this.IP.IP + "/edit/exportSummary",
        data: {
          ids: this.ids,
          time: this.regDate
        },
        responseType: "blob"
      })
        .then(result => {
          // console.info("zong");
          //console.log(result);
          this.downloadSummry(result);
          this.ids = [];
          this.undertakeDPListName = null;
          this.undertakePRListName = null;
          this.regDate = null;
          this.selectId = [];
          this.$Spin.hide();
        })
        .catch(error => {});
    },
    export2() {
      this.$Spin.show({
        render: h => {
          return h("div", [
            h("Icon", {
              class: "demo-spin-icon-load",
              props: {
                type: "ios-loading",
                size: 18
              }
            }),
            h("div", "Loading")
          ]);
        }
      });
      if (this.selectId.length > 0) {
        var i = 0;
        for (i = 0; i < this.selectId.length; i++) {
          this.ids.push(this.selectId[i].id);
        }
        // console.info("1");
        //console.log(this.ids);
        this.setTreeCondition();
        this.realExportSummary();
      } else {
        this.$ajax({
          method: "post",
          url: this.IP.IP + "/table/superSearchIds",
          data: {
            equalConditions: this.equalConditions,
            rangeConditions: this.rangeConditions,
            specialConditions: this.specialConditions
            //keyWord:this.keyword
          }
        }).then(result => {
          // console.info("2");
          //console.log(result.data.data)
          this.ids = result.data.data;
          this.setTreeCondition();
          this.realExportSummary();
        });
      }
    },
    exportClick() {
      var list = [];
      list.push(this.row);
      this.$Spin.show({
        render: h => {
          return h("div", [
            h("Icon", {
              class: "demo-spin-icon-load",
              props: {
                type: "ios-loading",
                size: 18
              }
            }),
            h("div", "Loading")
          ]);
        }
      });
      // console.log("row:" + this.row);
      // console.log("id:" + list);
      axios({
        method: "post",
        url: this.IP.IP + "/archive/exportTask",
        data: {
          ids: list
        },
        responseType: "blob",
        headers: {
          "Access-Control-Allow-Origin": "*"
        }
      })
        .then(result => {
          // console.info("zong");
          //console.log(result);
          this.download(result);
          this.$Spin.hide();
        })
        .catch(error => {
          //console.log(error);
        });
    },
    download(data) {
      if (!data) {
        return;
      }
      var blob = new Blob([data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
      });
      var url = window.URL.createObjectURL(data.data);
      var aLink = document.createElement("a");
      aLink.style.display = "none";
      aLink.href = url;
      aLink.setAttribute("download", "projectTask.xls");
      document.body.appendChild(aLink);
      aLink.click();
      document.body.removeChild(aLink); //下载完成移除元素
      window.URL.revokeObjectURL(url);
    },
    selectChange: function(data) {
      ////console.log(data);
      this.selectId = data;
      //console.log(this.selectId);
    },
    export1() {
      this.$Spin.show({
        render: h => {
          return h("div", [
            h("Icon", {
              class: "demo-spin-icon-load",
              props: {
                type: "ios-loading",
                size: 18
              }
            }),
            h("div", "Loading")
          ]);
        }
      });
      // console.info("select");
      //console.log(this.selectId.length);
      if (this.selectId.length > 0) {
        //选择了select
        var i = 0;
        for (i = 0; i < this.selectId.length; i++) {
          this.ids.push(this.selectId[i].id);
        }
        // console.info("1");
        //console.log(this.ids);
        this.setTreeCondition();
        this.realExport();
      } else {
        this.$ajax({
          method: "post",
          url: this.IP.IP + "/table/superSearchIds",
          data: {
            equalConditions: this.equalConditions,
            rangeConditions: this.rangeConditions,
            specialConditions: this.specialConditions
            //keyWord:this.keyword
          }
        }).then(result => {
          // console.info("2");
          //console.log(result.data.data)
          this.ids = result.data.data;
          this.setTreeCondition();
          this.realExport();
        });
      }
    },
    realExport() {
      axios({
        method: "post",
        url: this.IP.IP + "/edit/exportPerform",
        data: {
          ids: this.ids,
          time: this.regDate
        },
        responseType: "blob"
      })
        .then(result => {
          // console.info("zong");
          //console.log(result);
          this.downloadFile(result);
          this.$Spin.hide();
        })
        .catch(error => {});
      this.ids = [];
      this.selectId = [];
      this.regDate = null;
    },
    setTreeCondition() {
      //console.log("验证部门id"+this.valueId);
      if (this.valueId != 0) {
        axios({
          method: "get",
          url:
            this.IP.IP + "/searchForDepartmentById?departmentId=" + this.valueId
        }).then(result => {
          // console.info("打印部门名字");
          //console.log(result);
          this.undertakeDPListName = result.data.data.name;
          //console.log(this.undertakeDPListName+"111222");
        });
      } else {
        this.undertakeDPListName = "全部";
        this.undertakePRListName = "全部";
      }
      if (this.rangeConditions[2].sta) {
        this.regDate = this.rangeConditions[2].sta;
      } else if (!this.rangeConditions[2].end) {
        this.regDate = "全部";
      }
      if (this.rangeConditions[2].end) {
        this.regDate = this.regDate + "至" + this.rangeConditions[2].end;
      }
    },
    downloadFile(data) {
      if (!data) {
        return;
      }
      var blob = new Blob([data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
      });
      var url = window.URL.createObjectURL(data.data);
      var aLink = document.createElement("a");
      aLink.style.display = "none";
      aLink.href = url;
      aLink.setAttribute("download", "projectPerform.xls");
      document.body.appendChild(aLink);
      aLink.click();
      document.body.removeChild(aLink); //下载完成移除元素
      window.URL.revokeObjectURL(url);
    },
    addSpecial() {
      //添加进speciall
      // console.info("yewu");
      //console.log(this.spOutput);
      this.specialConditions = [];
      if (this.spCollect) {
        //处理收款
        this.specialConditions.push(this.spCollect);
      }
      if (this.spInvoice) {
        //处理发票
        this.specialConditions.push(this.spInvoice);
      }
      if (this.spReward) {
        //处理奖金
        this.specialConditions.push(this.spReward);
      }
    },
    setConditionNull() {
      var i = 0;
      if (!this.keyword) {
        this.keyword = null;
      }
      for (i = 0; i < this.rangeConditions.length; i++) {
        if (!this.rangeConditions[i].sta) {
          this.rangeConditions[i].sta = null;
        }
        if (!this.rangeConditions[i].end) {
          this.rangeConditions[i].end = null;
        }
      }
      for (i = 0; i < this.rangeConditions.length; i++) {
        if (this.rangeConditions[i].sta) {
          this.rangeConditions[i].sta = this.DateToString(
            this.rangeConditions[i].sta
          );
        }
        if (this.rangeConditions[i].end) {
          this.rangeConditions[i].end = this.DateToString(
            this.rangeConditions[i].end
          );
        }
      }
      if (!this.equalConditions.developmentOrganization) {
        //建设单位
        this.equalConditions.developmentOrganization = null;
      }

      if (!this.equalConditions.hasArchived) {
        //归档状态
        if (this.equalConditions.hasArchived != 0) {
          this.equalConditions.hasArchived = null;
        }
      }

      if (!this.equalConditions.name) {
        //项目名称
        this.equalConditions.name = null;
      }

      if (!this.equalConditions.province) {
        //省
        this.equalConditions.province = null;
      }
      if (!this.equalConditions.city) {
        //市
        this.equalConditions.city = null;
      }
      if (!this.equalConditions.area) {
        //区
        this.equalConditions.area = null;
      }
      if (!this.equalConditions.type) {
        //项目类别
        this.equalConditions.type = null;
      }
      if (!this.equalConditions.industryType) {
        //行业类别
        this.equalConditions.industryType = null;
      }

      if (!this.equalConditions.hasUsualSealed) {
        //盖章状态
        if (this.equalConditions.hasUsualSealed != 0) {
          this.equalConditions.hasUsualSealed = null;
        }
      }
      if (!this.equalConditions.hasContract) {
        //合同有无
        if (this.equalConditions.hasContract != 0) {
          this.equalConditions.hasContract = null;
        }
      }
      if (!this.equalConditions.undertakeDepartmentId) {
        //承接部门
        this.equalConditions.undertakeDepartmentId = null;
      }
      if (!this.equalConditions.undertakePersonId) {
        //承接人id
        this.equalConditions.undertakePersonId = null;
      }
      if (!this.equalConditions.auditDepartment) {
        //审批部门
        this.equalConditions.auditDepartment = null;
      }
      if (!this.equalConditions.auditorId) {
        //审核人员id
        this.equalConditions.auditorId = null;
      }
    },
    ClearCondition() {
      var i = 0;
      this.keyword = null;
      for (i = 0; i < this.rangeConditions.length; i++) {
        this.rangeConditions[i].sta = null;
        this.rangeConditions[i].end = null;
      }
      // console.log("range",this.rangeConditions)
      this.equalConditions.developmentOrganization = null;
      this.equalConditions.hasArchived = null;
      this.equalConditions.undertakeDepartmentId = null;
      this.equalConditions.undertakePersonId = null;
      this.equalConditions.name = null;
      this.equalConditions.type = null;
      this.equalConditions.province = null;
      this.equalConditions.city = null;
      this.equalConditions.area = null;
      this.equalConditions.industryType = null;
      this.equalConditions.hasUsualSealed = null;
      this.equalConditions.hasContract = null;
      this.equalConditions.auditDepartment = null;
      this.equalConditions.auditorId = null;

      this.specialConditions = [];
      this.spCollect = null;
      this.spInvoice = null;
      this.spReward = null;
    },
    HighClear() {
      this.ClearCondition();
      this.clearHigh = false;
    },
    cancelAdd() {
      this.organizationHigh = false;
    },
    checkAdd1() {
      //高级查询点确定
      this.setConditionNull(); //空字符串变null
      this.addSpecial();
      this.organizationHigh = false;
      this.clearHigh = true;
    },
    checkAdd(name) {
      //高级查询点确定
      // console.info("equal");
      // console.log(this.equalConditions);
      this.$refs[name].validate(valid => {
        if (valid) {
          this.setConditionNull(); //空字符串变null
          this.addSpecial();
          this.organizationHigh = false;
          this.clearHigh = true;
          // console.info("equal");
          // console.log(this.rangeConditions);
        } else {
          this.$Message.error("格式错误!");
        }
      });
    },
    OpenhihgLevelSearch() {
      this.organizationHigh = true;
    },
    hihgLevelSearch() {
      var u = this.IP.IP + "/table/superSearch";
      if (this.keyword) {
        u = this.IP.IP + "/table/superSearch?keyWord=" + this.keyword;
        this.checkAdd1();
      }
      this.pageNum = 1;
      this.$ajax({
        method: "post",
        url: u,
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 3
        },
        data: {
          equalConditions: this.equalConditions,
          rangeConditions: this.rangeConditions,
          specialConditions: this.specialConditions
        }
      }).then(result => {
        if (result.data.code == 0) {
          // console.info("高级查询结果");
          //console.log(result);
          this.data = result.data.data.data.list;
          var total = result.data.data.data.total;
          this.totalDataNo = total;
        } else {
          this.data = [];
          var msg = result.data.msg;
          this.$Message.error(msg);
        }
      });
    },
    hihgLevelSearch1() {
      var u = this.IP.IP + "/table/superSearch";
      if (this.keyword) {
        u = this.IP.IP + "/table/superSearch?keyWord=" + this.keyword;
      }
      this.$ajax({
        method: "post",
        url: u,
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 3
        },
        data: {
          equalConditions: this.equalConditions,
          rangeConditions: this.rangeConditions,
          specialConditions: this.specialConditions
        }
      }).then(result => {
        if (result.data.code == 0) {
          // console.info("高级查询结果");
          //console.log(result);
          this.data = result.data.data.data.list;
          //  var total = result.data.data.data.total;
          //  this.totalDataNo = total;
        } else {
          this.data = [];
          var msg = result.data.msg;
          this.$Message.error(msg);
        }
      });
    },
    changeprin(e) {
      //console.log(e);
      if (e.value == "16") {
        this.projectPrincple = this.huanPeo;
      } else {
        this.projectPrincple = this.allPeo;
      }
    },
    getHuanPeo() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getEiaPerson"
      }).then(result => {
        var total = result.data.data.length;
        var list = result.data.data;
        for (var i = 0; i < total; i++) {
          this.huanPeo.push({
            id: list[i].id + "",
            name: list[i].name + ""
          });
        }
        // console.info("环评人名单");
        //console.log(this.huanPeo);
      });
    },
    insertPeo() {
      // console.info("insetr");
      //console.log(this.allPeoPages);
      var i = 1;
      for (i = 1; i <= this.allPeoPages; i++) {
        axios({
          method: "get",
          url: this.IP.IP + "/personInfo/show?pageNum=" + i + "&pageSize=" + 10
        }).then(result => {
          var total = result.data.data.list.length;
          var list = result.data.data.list;
          // console.info("lentgh");
          // console.info(total);
          //console.log(list);
          for (var j = 0; j < total; j++) {
            this.allPeo.push({
              id: list[j].id + "",
              name: list[j].name + ""
            });
            // console.info(i);
            // //console.log(this.allPeo);
          }
        });
      }
      // console.info("所有人名单");
      //console.log(this.allPeo);
    },
    getAllPeo() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/show?pageNum=" + 1 + "&pageSize=" + 10
      }).then(result => {
        this.allPeoPages = result.data.data.pages;
        // console.info("pages111");
        //console.log(this.allPeoPages);
        this.insertPeo();
      });
      //this.insertPeo();
    },
    getCarerType() {
      axios({
        method: "get",
        url: this.IP.IP + "/getIndustryTypes?pageNumber=" + 1
      }).then(result => {
        var total = result.data.data.total;
        var list = result.data.data.list;
        for (var i = 0; i < total; i++) {
          this.carerType.push({
            id: list[i].id + "",
            name: list[i].name + ""
          });
        }
        // console.info("行业类别名单");
        //console.log(this.carerType);
      });
    },
    getEditpersonList() {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getEditPerson"
      }).then(result => {
        var total = result.data.data.length;
        var list = result.data.data;
        for (var i = 0; i < total; i++) {
          this.editPerList.push({
            id: list[i].personId + "",
            name: list[i].personName + ""
          });
        }
        // console.info("编制人名单");
        //console.log(this.editPerList);
      });
    },
    getproType() {
      axios({
        method: "get",
        url: this.IP.IP + "/getProjectTypes?pageNumber=" + 1
      }).then(result => {
        var total = result.data.data.total;
        var list = result.data.data.list;
        for (var i = 0; i < total; i++) {
          this.proType.push({
            id: list[i].id + "",
            name: list[i].name + ""
          });
        }
        // console.info("项目类别");
        //console.log(this.proType);
      });
    },

    getpageSize(e) {
      // console.info("每页条数");
      //console.log(e);
      this.pageSize = e;
      this.getNewData();
    },
    getpageNum(e) {
      // console.info("当前页");
      //console.log(e);
      this.pageNum = e;
      if (this.clearHigh) {
        this.hihgLevelSearch1();
      } else {
        this.getNewData1();
      }
    },
    insertEdit() {
      this.submitEditInfo.auditDepartment = this.editinfo.auditDepartmentName;
      this.submitEditInfo.principle = this.editinfo.principle;
      this.submitEditInfo.tableAuditor = this.editinfo.tableAuditor;
      this.submitEditInfo.industryType = this.editinfo.industryType;
      this.submitEditInfo.auditor = this.editinfo.auditor;
      // console.info("sa");
      //console.log(this.submitEditInfo);
      this.submitEditInfo.editPersonId = this.editinfo.editPersonId;
      this.submitEditInfo.type = this.editinfo.type;
      this.submitEditInfo.province = this.editinfo.province;
      this.submitEditInfo.city = this.editinfo.city;
      this.submitEditInfo.area = this.editinfo.area;
      this.submitEditInfo.developmentOrganization = this.editinfo.developmentOrganization;
      //realFinishDate
      if (this.editinfo.auditDate) {
        this.submitEditInfo.auditDate = this.DateToString(
          this.editinfo.auditDate
        );
      } else {
        this.submitEditInfo.auditDate = this.editinfo.auditDate;
      }
      if (this.editinfo.realFinishDate) {
        this.submitEditInfo.realFinishDate = this.DateToString(
          this.editinfo.realFinishDate
        );
      } else {
        this.submitEditInfo.realFinishDate = this.editinfo.realFinishDate;
      }

      this.submitEditInfo.name = this.editinfo.name;
      this.submitEditInfo.remark = this.editinfo.remark;
      this.submitEditInfo.taskNumber = this.editinfo.taskNumber;
      this.submitEditInfo.projectLevel = this.editinfo.projectLevel;
      this.submitEditInfo.productionScale = this.editinfo.productionScale;
      // this.submitEditInfo.realFinishDate = this.editinfo.realFinishDate;
      this.submitEditInfo.auditNumber = this.editinfo.auditNumber;
      this.submitEditInfo.envInvestment = this.editinfo.envInvestment;
      this.submitEditInfo.totalInvestment = this.editinfo.totalInvestment;
      this.submitEditInfo.contactPhone = this.editinfo.contactPhone;
      this.submitEditInfo.contact = this.editinfo.contact;
    },
    DateToString(date) {
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      if (month < 10) {
        var newmonth = "0" + month;
        month = newmonth;
      }
      if (day < 10) {
        var newday = "0" + day;
        day = newday;
      }
      var sDate = year + "-" + month + "-" + day;
      return sDate;
    },
    realCreate() {
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/edit/editProject",
        params: {
          projectId: this.row
        },
        data: this.submitEditInfo
      }).then(result => {
        // console.info("确定新建");
        //console.log(result);
        var code = "";
        code = result.data.code;
        var msg = result.data.msg;
        if (code == 0) {
          this.$Message.success("编制项目成功");
          this.getNewData1();
          //this.getNewData();
        } else {
          this.$Message.error(msg);
        }
        this.orgDtailedit = false;
      });
    },
    submitorgedit(name) {
      let that = this;
      var flag = 0;
      this.$refs[name].validate(valid => {
        if (valid) {
          this.insertEdit();
          // console.info("编辑信息");
          //console.log(this.submitEditInfo);
          this.realCreate();
        } else {
          this.$Message.error("未填完整!");
        }
      });
      // this.insertEdit();
      // console.info("编辑信息");
      // //console.log(this.submitEditInfo);
      // this.realCreate();
    },
    geteditInfo() {
      axios({
        method: "get",
        url: this.IP.IP + "/edit/getEdit?projectId=" + this.row
      }).then(result => {
        ////console.log(this.row);
        this.editinfo = result.data.data;
        if (this.editinfo.typeId) {
          this.editinfo.type = result.data.data.typeId + "";
        }
        if (this.editinfo.industryType) {
          this.editinfo.industryType = result.data.data.industryType + "";
        }
        if (this.editinfo.principle) {
          this.editinfo.principle = result.data.data.principle + "";
        }
        if (this.editinfo.auditor) {
          this.editinfo.auditor = result.data.data.auditor + "";
        }
        if (this.editinfo.editPersonId) {
          this.editinfo.editPersonId = this.editinfo.editPersonId + "";
        }
        // console.info("a");
        //console.log( this.editinfo);
        if (this.editinfo.tableAuditor) {
          this.editinfo.tableAuditor = result.data.data.tableAuditor + "";
        }
        if (this.editinfo.type == "16") {
          this.projectPrincple = this.huanPeo;
        } else {
          this.projectPrincple = this.allPeo;
        }
        this.corse1.label = result.data.data.province;
        this.corse2.label = result.data.data.city;
        this.corse3.label = result.data.data.area;
        // console.info("市");
        //console.log(this.corse1)
        //console.log(this.corse2)
        //console.log(this.corse3)
        this.choseProvince(this.corse1);
        this.choseCity(this.corse2);
        this.choseBlock(this.corse3);
      });
    },
    getTabId(id) {
      // console.info("tab");
      //console.log(id);
      this.tabID = id;
    },
    setBackdata(st) {
      //console.log(this.row);
      this.callbackdata = this.row;
      this.callbackState = st;
    },
    getcolumns() {
      axios({
        method: "post",
        url:
          this.IP.IP +
          "/table/show?pageNum=" +
          this.pageNum +
          "&pageSize=" +
          this.pageSize +
          "&modelId=" +
          this.modelId
      }).then(result => {
        let that = this;

        var fields = result.data.data.fields;
        var attribute = result.data.data.attribute;
        //var list=result.data.data.data.list;
        var i = 0;
        //console.log(result);
        for (i; i < fields.length; i++) {
          if (attribute[i] == "editRemark") {
            this.columns.push({
              title: fields[i],
              width: 160,
              key: attribute[i],
              tooltip: true,
              render: (h, params) => {
                let texts = ""; //表格列显示文字
                if (params.row.editRemark !== null) {
                  if (params.row.editRemark.length > 6) {
                    //进行截取列显示字数
                    texts = params.row.editRemark.substring(0, 9) + ".....";
                  } else {
                    texts = params.row.editRemark;
                  }
                }
                return h("div", [
                  h(
                    "Tooltip",
                    {
                      props: {
                        placement: "bottom"
                        // transfer: true  //是否将弹层放置于 body 内
                      },
                      style: {
                        cursor: "pointer"
                      }
                    },
                    [
                      //这个中括号表示是Tooltip标签的子标签
                      texts, //表格列显示文字
                      h(
                        "div",
                        {
                          slot: "content",
                          style: {
                            whiteSpace: "normal"
                          }
                        },
                        params.row.editRemark //整个的信息即气泡内文字
                      )
                    ]
                  )
                ]);
              }
            });
          } else {
            this.columns.push({
              title: fields[i],
              width: 160,
              key: attribute[i]
            });
          }
        }
        //this.data=list;
      });
    },
    getcolumns1() {
      //console.log("UserId:"+this.userID);
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: 1,
          pageSize: 30,
          modelId: 3
        },
        data: {
          principleId: this.userID
        }
      }).then(result => {
        //console.log(result)
        let that = this;
        var list = result.data.data.data.list;
        this.data1 = list;

        var fields = result.data.data.fields;
        var attribute = result.data.data.attribute;
        //var list=result.data.data.data.list;
        var i = 0;
        //console.log(result);
        for (i; i < fields.length; i++) {
          if (attribute[i] == "editRemark") {
            this.columns1.push({
              title: fields[i],
              width: 160,
              key: attribute[i],
              tooltip: true,
              render: (h, params) => {
                let texts = ""; //表格列显示文字
                if (params.row.editRemark !== null) {
                  if (params.row.editRemark.length > 6) {
                    //进行截取列显示字数
                    texts = params.row.editRemark.substring(0, 6) + ".....";
                  } else {
                    texts = params.row.editRemark;
                  }
                }
                return h("div", [
                  h(
                    "Tooltip",
                    {
                      props: {
                        placement: "bottom"
                        // transfer: true  //是否将弹层放置于 body 内
                      },
                      style: {
                        cursor: "pointer"
                      }
                    },
                    [
                      //这个中括号表示是Tooltip标签的子标签
                      texts, //表格列显示文字
                      h(
                        "div",
                        {
                          slot: "content",
                          style: {
                            whiteSpace: "normal"
                          }
                        },
                        params.row.editRemark //整个的信息即气泡内文字
                      )
                    ]
                  )
                ]);
              }
            });
          } else {
            this.columns1.push({
              title: fields[i],
              width: 160,
              key: attribute[i]
            });
          }
        }
        //this.data=list;
      });
    },
    getTable() {
      axios({
        method: "post",
        url:
          this.IP.IP +
          "/table/show?pageNum=" +
          this.pageNum +
          "&pageSize=" +
          this.pageSize +
          "&modelId=" +
          this.modelId
      }).then(result => {
        let that = this;

        var list = result.data.data.data.list;
        //var i=0;
        //console.log(result);

        this.data = list;
      });
    },
    format(labels, selectedData) {
      const index = labels.length - 1;
      const data = selectedData[index] || false;
      if (data && data.code) {
        return labels[index];
      }
      return labels[index];
    },
    getdepartments() {
      axios({
        method: "get",
        url: this.IP.IP + "/getDepartments"
      }).then(result => {
        // console.info("部门信息");
        //console.log(result);
        var data = result.data.data;
        this.dataTree = [];
        var i = 0;
        for (i = 0; i < data.length; i++) {
          this.setNode(data[i]);
        }
        this.dataTree = data;
        this.dataTree.unshift({ value: 0, label: "全部", children: [] });
        // console.info("部门树");
        //console.log(this.dataTree);
        //console.info('')
        ////console.log(this.valueId);
      });
    },
    setNode(node) {
      if (node != null) {
        node.label = node.nodeDepartmentIndex.name;
        node.value = node.nodeDepartmentIndex.id;
        node.children = node.childrenDepartmentIndexes;
        this.dptList.push({
          id: node.value + "",
          name: node.label
        });
        var i = 0;
        for (i = 0; i < node.childrenDepartmentIndexes.length; i++) {
          this.setNode(node.childrenDepartmentIndexes[i]);
        }
      }
    },
    getpersonPage(value) {
      axios({
        method: "get",
        url: this.IP.IP + "/personInfo/getEtPsnByDeId?departmentId="+value
      }).then(result => {
        //this.personName = result.data.data.list;
        if (result.data.code == 0) {
          this.perNo = result.data.data;
          // console.info("页数");
          // console.log(this.perNo);
          // this.getperson();
          if (this.perNo) {
            for (var i = 0; i < this.perNo.length; i++) {
              this.personName.push({
                id: this.perNo[i].personId + "",
                name: this.perNo[i].personName + ""
              });
            }
          }
        }
      });
    },
    getperson() {
      var i = 0;
      for (i = 1; i <= this.perNo; i++) {
        axios({
          method: "get",
          url:
            this.IP.IP +
            "/getDepartmentsConsistent?departmentId=" +
            this.valueId +
            "&pageNumber=" +
            i +
            "&pageSize=5"
        }).then(result => {
          var size = result.data.data.size;
          var list = result.data.data.list;
          this.personName = this.personName.concat(list);
        });
      }
      //this.personName.unshift({ id: 0, name: "全部" });
      // console.info("人员名单");
      //console.log(this.personName);
    },
    getperId(e) {
      //console.log(e);
      this.valueId2 = e.value;
      // console.info("选中人员ID");
      // console.log(this.valueId2);
      // console.info("部门选择不是全部的MOdal1的值");
      // console.log(this.model1);
    },
    getValue(e) {
       var i = e.length;
      this.valueId = e[i - 1];
      if (this.valueId != 0) {
        this.personName = [{ id: 0, name: "全部" }];
        this.getpersonPage(value);
      } else {
        this.model1 = 0;
        this.personName = [{ id: 0, name: "全部" }];
      }
    },
    getNowYear() {
      var date = new Date();
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var day = date.getDate();
      if (month < 10) {
        var newmonth = "0" + month;
        month = newmonth;
      }
      if (day < 10) {
        var newday = "0" + day;
        day = newday;
      }
      var sDate = year + "-" + month + "-" + day;
      this.nowyear = year;
      this.nowDate = sDate;
      // console.info("当前年");
      //console.log(this.nowyear);
      //console.log(this.nowDate);
      for (var i = 2005; i <= this.nowyear; i++) {
        this.yearName.push({ id: i, name: i + "" });
      }
      this.yearName.unshift({ id: 0, name: "全部" });
      // console.info("年份数组");
      //console.log(this.yearName);
    },
    getyear(e) {
      //console.log(this.model2);
    },
    //select获取选择的data全部信息

    closeorganizationedtail() {
      let that = this;
      this.$Modal.confirm({
        title: "确定关闭吗？",
        onOk() {
          that.organizationDtail = false;
        }
      });
    },
    getNewData1() {
      this.data = [];
      if (this.valueId != 0) {
        this.select1 = this.valueId;
      }
      if (this.model1 != 0) {
        this.select2 = this.model1;
      }
      if (this.model2 != 0) {
        this.select3 = this.model2 + "";
      }
      // console.info("select123");
      //console.log(this.select1);
      //console.log(this.select2);
      //console.log(this.select3);
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: this.pageNum,
          pageSize: 10,
          modelId: 3
        },
        data: {
          editPersonId: this.select2,
          finishDepartmentId: this.select1,
          registDate: this.select3
        }
      }).then(response => {
        this.data = response.data.data.data.list;
        //console.info('111');
        ////console.log(fields);
        // var total = response.data.data.data.total;
        // this.totalDataNo = total;
        // console.info("total");
        // //console.log(this.totalDataNo);
        this.select1 = null;
        this.select2 = null;
        this.select3 = null;
      });
    },
    getNewData() {
      this.data = [];
      if (this.valueId != 0) {
        this.select1 = this.valueId;
      }
      if (this.model1 != 0) {
        this.select2 = this.model1;
      }
      if (this.model2 != 0) {
        this.select3 = this.model2 + "";
      }
      // console.info("select123");
      // console.log(this.select1);
      // console.log(this.select2);
      // console.log(this.select3);
      this.$ajax({
        method: "post",
        url: this.IP.IP + "/table/show",
        params: {
          pageNum: 1,
          pageSize: 10,
          modelId: 3
        },
        data: {
          editPersonId: this.select2,
          finishDepartmentId: this.select1,
          registDate: this.select3
        }
      }).then(response => {
        this.data = response.data.data.data.list;
        // console.info('data');
        // console.log(this.data);
        var total = response.data.data.data.total;
        this.totalDataNo = total;
        // console.info("total");
        //console.log(this.totalDataNo);
        this.select1 = null;
        this.select2 = null;
        this.select3 = null;
      });
    },

    closeorgedit() {
      let that = this;
      this.$Modal.confirm({
        title: "确定关闭吗？",
        onOk() {
          that.orgDtailedit = false;
        }
      });
    }
  }
};
</script>

<style>
.search-block1 {
  padding: 5px;
  display: inline-block;
  width: 180px;
  height: 50px;
}
.swith-btn {
  padding: 5px;
}
.search-bar {
  width: 100%;
}
.search-block {
  padding: 5px;
  display: inline-block;
  width: 300px;
  height: 50px;
}
.search-block span {
  line-height: 50px;
}
.search-block .ivu-select {
  width: 150px;
}
.senior-search-block {
  height: 50px;
  padding: 5px;
}
.search-content {
  width: 200px;
}
</style>